home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-19 | 1.0 KB | 42 lines | [TEXT/?bDv] |
- !
- ! Seeker
- !
- ! This bot scans around in a circle until it finds another bot.
- ! It locks on to the bot, firing until the enemy bot leaves the
- ! arc of the scanner. Then it resumes scanning.
- !
-
- #DATA
-
-
- DEF scanAt ! Current scan angle
-
- EQU INCREMENT 7 ! Amount to add to scan angle each time
-
-
- #CODE BASIC
-
- :Initialize
- scanAt = Random(360) ! Start at a random angle
-
- :ScanLoop
- scanAt = scanAt + INCREMENT
- Scan Angle scanAt
- If ($FOUND == 0) Then Goto ScanLoop
- ! $FOUND == 0 means that nothing was
- ! found.
- ! ... so continue around in a circle
- ! ... otherwise, go on to ScanLock
- :ScanLock
- Fire Weapon 1, & ! Fire the (primary) weapon
- Angle $ANGLE ! At the angle returned by the scanner.
- ! The '&' allows you to continue a line
- ! of code on the next line.
- Scan Angle scanAt ! Check to see if enemy is still there
- If ($FOUND == 0) Then
- Goto ScanLoop ! If not, resume scanning
- Goto ScanLock ! If so, keep firing until he dies or
- ! moves.
-
- #END
-